import plotly.express as px
import numpy as np
active_uids = np.genfromtxt('https://media-zip1.baydn.com/storage_media_zip/qkklny/22f0e6eaefcfb277176d59e8125cf505.f75f6a24bf8052409e4a0ca5b52c951a.csv')
enterbook_uids = np.genfromtxt('https://media-zip1.baydn.com/storage_media_zip/qkklny/aa3af5c54faea4567e02056fb96f0d09.d6312693cb816c2454eba79e46d9ba8c.csv')
trial_uids = np.genfromtxt('https://media-zip1.baydn.com/storage_media_zip/qkklny/91b8b8a4df4f78b7ebae222cef306f9a.5a61749229d5f45c8a3336815ab0552c.csv')
paid_uids = np.genfromtxt('https://media-zip1.baydn.com/storage_media_zip/qkklny/8e25e9bffcce021c90335ec6900efb4b.28080b0032a0f39617346f4eead7f548.csv')
active_uids_set = set(active_uids)
enterbook_uids_set = set(enterbook_uids)
trial_uids_set = set(trial_uids)
paid_uids_set = set(paid_uids)
num_active_uids = len(active_uids)
num_enterbook_uids = len(enterbook_uids)
num_trial_uids = len(trial_uids)
num_paid_uids = len(paid_uids)
data = dict(
    number=[num_active_uids,num_enterbook_uids,num_trial_uids,num_paid_uids],
    stage=["活跃用户数量", "进入书籍页面数量", "试读用户数量", "购书用户数量"])
fig = px.funnel(data, x='number', y='stage')
fig.show()
